/**
 * 工序实现类
 */
export default  class ProcessEntity {
    constructor(id,name, type, constraints, status) {
        this.id=id;
        this.name = name;
        this.type = type;
        this.constraints = constraints;
      //  this.setStatus(status);
    }

    setStatus(status) {
        const validStatus = ['In Progress', 'Completed', 'Pending'];
        if (!validStatus.includes(status)) {
            throw new Error("Invalid status.");
        }
        this.status = status;
    }

    updateStatus(newStatus) {
        this.setStatus(newStatus);
        console.log(`The status of ${this.name} is now ${newStatus}.`);
    }
}

